# Maintainer: Guillaume ALAUX <guillaume@archlinux.org>
_libname=xml-commons-resolver
pkgname=java-resolver
pkgver=1.2
pkgrel=1
pkgdesc="XML entity and URI resolver library"
arch=('any')
url="http://xml.apache.org/commons/components/resolver/"
license=('APACHE')
depends=('java-runtime-headless')
makedepends=('apache-ant')
checkdepends=('apache-ant')
source=(http://archive.apache.org/dist/xml/commons/${_libname}-${pkgver}.tar.gz)
md5sums=('46d52acdb67ba60f0156043f30108766')

build() {
  cd "${srcdir}/${_libname}-${pkgver}"
  ant \
    -f resolver.xml \
    jar
}

check() {
  cd "${srcdir}/${_libname}-${pkgver}"
  ant \
    -f resolver.xml \
    check
}

package() {
  cd "${srcdir}/${_libname}-${pkgver}/build"
  install -Dm644 resolver.jar ${pkgdir}/usr/share/java/resolver-${pkgver}.jar
  ln -s resolver-${pkgver}.jar ${pkgdir}/usr/share/java/resolver.jar
}
